package com.bdqn.util;
/*
 * 读取属性配置文件中的信息
 */

import java.io.FileReader;
import java.io.IOException;
import java.util.Properties;

public class PropertiesUtil {

	//声明properties对象
	private static Properties properties;
	static {
		properties=new Properties();
		//把属性配置文件中的信息读取并加载到properties对象中
		String dbConfigPath = PropertiesUtil.class.getClassLoader().getResource(KeyConstants.DB_CONFIG_PATH).getPath();
		try {
			properties.load(new FileReader(dbConfigPath));
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
	
	public static String getProperty(String key) {
		
		return properties.getProperty(key);
	}
}
